package com.katze.boot.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.katze.boot.plugins.feign.FeignUri;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * URI管理
 * @TableName sys_uri
 */
@Data
@TableName("sys_uri")
public class SysUri implements FeignUri, Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * URI字符串
     */
    private String uri;

    /**
     * URI描述
     */
    private String description;

    /**
     * 类型
     */
    private String category;

    /**
     * 资源类型，1：API、2：WEB
     */
    private String resourceType;

    /**
     * 状态，0：INACTIVE非激活， 1：ACTIVE激活
     */
    private String status;

    /**
     * 应用唯一标识
     */
    private String appId;

    /**
     * 应用的公匙
     */
    private String appKey;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建者
     */
    private Long creator;


    @Override
    public String toString() {
        return getClass().getSimpleName() +
                " [" +
                "Hash = " + hashCode() +
                ", id=" + id +
                ", uri=" + uri +
                ", description=" + description +
                ", type=" + category +
                ", resourceType=" + resourceType +
                ", status=" + status +
                ", appId=" + appId +
                ", appKey=" + appKey +
                ", createTime=" + createTime +
                ", creator=" + creator +
                ", serialVersionUID=" + serialVersionUID +
                "]";
    }

    @Override
    public String getServiceId() {
        return getId();
    }
}